/* 全局设置 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #1abc9c;
    --background-color: #f5f7fa;
    --card-color: #ffffff;
    --text-color: #333;
    --border-color: #e0e0e0;
    --break-color: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 头部样式 */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.logo i {
    margin-right: 10px;
    font-size: 1.4rem;
}

.mode-toggle {
    display: flex;
    gap: 10px;
}

.mode-toggle button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.mode-toggle button i {
    margin-right: 5px;
}

.mode-toggle button.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile i {
    font-size: 1.5rem;
}

/* 内容区域 */
.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* 工作模式看板 */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    gap: 20px;
    height: calc(100vh - 140px);
}

.stat-card {
    background: var(--card-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    grid-column: 1 / 3;
}

.stat-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #777;
}

.timer-card {
    background: var(--card-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.timer-display {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.timer-circle {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.timer-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(var(--secondary-color) 0%, transparent 0%);
    transition: background 0.3s;
}

.timer-text {
    position: relative;
    z-index: 1;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.timer-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.timer-controls button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
}

.timer-controls button i {
    margin-right: 8px;
}

.timer-controls button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.timer-controls button:not(:disabled):hover {
    background-color: #2980b9;
}

.next-break {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 0.9rem;
}

.next-break i {
    color: var(--break-color);
}

.task-card {
    background: var(--card-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.task-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 1.2rem;
}

.task-list {
    list-style-type: none;
    margin-bottom: 20px;
    flex: 1;
    overflow-y: auto;
}

.task-list li {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.task-list li input[type="checkbox"] {
    margin-right: 10px;
}

.add-task {
    display: flex;
    gap: 10px;
}

.add-task input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.add-task button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 40px;
    cursor: pointer;
}

/* 休息模式样式 */
.break-container {
    display: flex;
    height: calc(100vh - 140px);
    gap: 20px;
}

.break-timer {
    flex: 0 0 250px;
    background: var(--card-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.break-timer h3 {
    color: var(--break-color);
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.break-circle .timer-progress {
    background: conic-gradient(var(--break-color) 0%, transparent 0%);
}

.break-timer p {
    margin-top: 20px;
    text-align: center;
    color: #666;
}

.break-content {
    flex: 1;
    background: var(--card-color);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.content-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 15px 25px;
    border: none;
    background: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background-color: #f5f5f5;
    border-bottom: 2px solid var(--secondary-color);
    font-weight: bold;
}

.tab-content {
    flex: 1;
    overflow: hidden;
}

.tab-panel {
    display: none;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
}

.tab-panel.active {
    display: block;
}

.game-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.game-card {
    flex: 1;
    height: 80px;
    background-color: #f5f5f5;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.game-card:hover {
    background-color: #e0e0e0;
    transform: translateY(-3px);
}

.game-card i {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.game-container {
    height: 400px;
    background-color: #f9f9f9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.article h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

#more-facts {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

.relax-option {
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.relax-option h4 {
    margin-bottom: 10px;
    color: var(--primary-color);
}

.relax-option button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 底部状态栏 */
.footer {
    background-color: #f5f5f5;
    border-top: 1px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.achievements {
    display: flex;
    align-items: center;
    gap: 8px;
}

.achievements i {
    color: gold;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator.working::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #2ecc71;
    border-radius: 50%;
}

.switch-button {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* 成就弹窗 */
.achievement-popup {
    position: fixed;
    bottom: 30px;
    right: -300px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 250px;
    transition: right 0.5s;
}

.achievement-popup.show {
    right: 30px;
}

.achievement-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.achievement-content i {
    font-size: 2rem;
    color: gold;
    margin-bottom: 10px;
}

.achievement-content button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    margin-top: 10px;
    cursor: pointer;
}

/* 紧急模式 */
/* 紧急模式 Excel 风格样式 */
.emergency-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f8f9fa;
    z-index: 1000;
    display: none;
    overflow: hidden;
}

.excel-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.excel-header {
    background-color: #217346;
    color: white;
}

.excel-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #185a32;
    padding: 0 0 0 10px; /* 调整左侧padding，移除右侧padding */
    height: 32px;
}

.excel-icon {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-right: 10px;
}

.excel-icon i {
    margin-right: 5px;
}

.excel-tabs {
    display: flex;
    flex-grow: 1;
    height: 100%;
}

.excel-tab {
    padding: 0 15px;
    margin-right: 2px;
    background-color: #217346;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    font-size: 13px;
    display: flex;
    align-items: center;
    height: 100%;
}

.excel-tab.active {
    background-color: #f8f9fa;
    color: #333;
}
.excel-controls {
    display: flex;
    align-items: center;
}
.excel-controls button {
    background: none;
    border: none;
    color: white;
    margin-left: 5px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.excel-controls button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.excel-controls button:last-child:hover {
    background-color: #e81123;
}
.window-control {
    background: none;
    border: none;
    color: white;
    width: 46px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.window-control:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.window-control.minimize-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.window-control.maximize-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.window-control.close-btn:hover {
    background-color: #e81123;
}

.excel-menu-bar {
    display: flex;
    padding: 5px 10px;
    font-size: 13px;
}

.excel-menu-bar div {
    padding: 5px 10px;
    cursor: pointer;
}

.excel-menu-bar div:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.excel-toolbar {
    display: flex;
    background-color: #f8f9fa;
    color: #333;
    padding: 5px 10px;
    border-bottom: 1px solid #ddd;
}

.tool-group {
    display: flex;
    margin-right: 10px;
    padding-right: 10px;
    border-right: 1px solid #ddd;
}

.tool-group:last-child {
    border-right: none;
}

.tool-group button {
    background: none;
    border: none;
    padding: 5px;
    margin: 0 2px;
    cursor: pointer;
    color: #333;
}

.tool-group button:hover {
    background-color: #e6e6e6;
}

.tool-group select {
    margin: 0 2px;
    height: 25px;
    border: 1px solid #ddd;
}

.excel-formula-bar {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    color: #333;
    padding: 5px 10px;
    border-bottom: 1px solid #ddd;
}

.formula-label {
    width: 25px;
    text-align: center;
    font-weight: bold;
    color: #217346;
    margin-right: 5px;
}

.cell-address {
    width: 50px;
    text-align: center;
    border: 1px solid #ddd;
    margin-right: 5px;
    padding: 2px 5px;
}

.excel-formula-bar input {
    flex-grow: 1;
    padding: 2px 5px;
    border: 1px solid #ddd;
}

.excel-body {
    flex-grow: 1;
    overflow: auto;
    position: relative;
}

.excel-column-headers {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #f8f9fa;
}

.excel-column-headers div {
    width: 100px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    background-color: #f0f0f0;
    font-weight: bold;
    color: #333;
}

.row-header {
    width: 40px !important;
    min-width: 40px !important;
    background-color: #f0f0f0;
    font-weight: bold;
    color: #333;
}

.excel-row {
    display: flex;
    height: 25px;
}

.excel-cell {
    width: 100px;
    height: 100%;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excel-cell.selected {
    background-color: #e8f1ff;
    border: 2px solid #217346;
}

.excel-cell.formula {
    color: #217346;
    font-weight: bold;
}

.excel-cell.long-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excel-footer {
    display: flex;
    justify-content: space-between;
    background-color: #f8f9fa;
    border-top: 1px solid #ddd;
    padding: 5px 10px;
}

.sheet-tabs {
    display: flex;
    align-items: center;
}

.sheet-tab {
    padding: 5px 15px;
    margin-right: 2px;
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.sheet-tab.active {
    background-color: #fff;
    border-bottom-color: #fff;
}

.zoom-controls {
    display: flex;
    align-items: center;
}

.zoom-controls span {
    margin-right: 10px;
}

.zoom-controls button {
    background: none;
    border: none;
    color: #217346;
    font-size: 16px;
    cursor: pointer;
    margin-left: 5px;
}

/* 成就面板样式 */
.achievements-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    max-width: 90%;
    max-height: 80vh;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 900;
    display: none;
    overflow: hidden;
}

.achievements-panel.show {
    display: block;
}

.achievements-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--secondary-color);
    color: white;
}

.achievements-header h3 {
    margin: 0;
}

.close-achievements {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.achievements-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 60px);
}

.achievements-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.achievement-item {
    display: flex;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    background-color: #f0f8ff;
    opacity: 1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
    background-color: #ddd;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: #888;
    font-size: 20px;
}

.achievement-item.unlocked .achievement-icon {
    background-color: var(--secondary-color);
    color: white;
}

.achievement-info {
    flex-grow: 1;
}

.achievement-info h4 {
    margin: 0 0 5px 0;
    color: #444;
}

.achievement-info p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.achievement-status {
    display: flex;
    align-items: center;
    color: #888;
    font-size: 18px;
}

.achievement-item.unlocked .achievement-status {
    color: #27ae60;
}

/* 设置面板样式 */
.settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    max-width: 90%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 900;
    display: none;
    overflow: hidden;
}

.settings-panel.show {
    display: block;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--secondary-color);
    color: white;
}

.settings-header h3 {
    margin: 0;
}

.close-settings {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.settings-body {
    padding: 20px;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.setting-item input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.save-settings {
    width: 100%;
    padding: 10px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

.save-settings:hover {
    background-color: var(--primary-color);
}

/* 任务列表样式修改 */
#task-list li {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    background-color: #f9f9f9;
    padding: 8px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#task-list li:hover {
    background-color: #f0f0f0;
}

#task-list li label {
    flex-grow: 1;
    margin-left: 10px;
    cursor: pointer;
}

.delete-task {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.delete-task:hover {
    opacity: 1;
}

/* 按钮样式 */
.settings-btn, .view-achievements-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    font-size: 18px;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.settings-btn:hover, .view-achievements-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

/* 状态指示器样式 */
.status-indicator {
    display: flex;
    align-items: center;
    padding: 0 10px;
}

.status-indicator span {
    margin-left: 5px;
}

.status-indicator.working {
    --status-color: #2ecc71;
}

.status-indicator.breaking {
    --status-color: var(--break-color);
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--status-color);
    animation: pulse 2s infinite;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    .stat-card {
        grid-column: 1;
    }
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .break-container {
        flex-direction: column;
    }
    .break-timer {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
    
    .mode-toggle button span {
        display: none;
    }
    
    .mode-toggle button i {
        margin-right: 0;
    }
    
    .timer-circle {
        width: 150px;
        height: 150px;
    }
    
    .timer-text {
        font-size: 2rem;
    }
    
    .game-options {
        flex-direction: column;
    }
    
    .header {
        padding: 10px;
    }
    
    .logo span {
        display: none;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 1s infinite;
}

/* 游戏样式 */
.minesweeper-grid {
    display: grid;
    grid-template-columns: repeat(8, 30px);
    grid-template-rows: repeat(8, 30px);
    gap: 2px;
}

.minesweeper-cell {
    width: 30px;
    height: 30px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

.minesweeper-cell.revealed {
    background-color: #f0f0f0;
}

.minesweeper-cell.flagged::after {
    content: "🚩";
}

.pixel-art-grid {
    display: grid;
    grid-template-columns: repeat(16, 20px);
    grid-template-rows: repeat(16, 20px);
    gap: 1px;
}

.pixel {
    width: 20px;
    height: 20px;
    background-color: white;
    border: 1px solid #ddd;
    cursor: pointer;
}

.color-palette {
    display: flex;
    gap: 5px;
    margin-bottom: 10px;
}

.color-option {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
}

.color-option.selected {
    border-color: black;
}

.snake-game {
    position: relative;
    width: 300px;
    height: 300px;
    background-color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.snake-board {
    width: 300px;
    height: 300px;
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    background-color: #f9f9f9;
    border: 2px solid #333;  /* 添加边框使游戏界面更明显 */
}

.snake-cell {
    border: 1px solid #bbb;  /* 加深边界线颜色 */
    background-color: #fff;  /* 改变背景色与容器背景形成对比 */
}

.snake-cell.snake {
    background-color: #2ecc71;
    border-radius: 4px;  /* 圆角使蛇身更美观 */
}

.snake-cell.food {
    background-color: #e74c3c;
    border-radius: 50%;
}


.snake-score {
    margin-top: 10px;
    font-weight: bold;
}

.snake-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

